package com.wu.constant.Enum;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Cousin
 * @date 2025/1/7
 * @Description
 */
@AllArgsConstructor
@Getter
public enum ResourceTypeAndNameEnum {
    SONG(1,"歌曲"),SONG_LIST(2,"歌单");
    /**
     * 类型
     */
    private final Integer type;
    /**
     * 名称
     */
    private final String name;
    public  static  String getNameByType(String type) {
        int parsedInt = Integer.parseInt(type);
        for (ResourceTypeAndNameEnum e : ResourceTypeAndNameEnum.values()) {
            if (e.getType().equals(parsedInt)) {
                return e.getName();
            }
        }
        return "未知";
    }
}
